package com.rzjm.api.netty.water.constant;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @author WangWT
 * @Description: 下发设备数据的rt
 * @date 2023/4/18 15:31
 */
@Getter
@RequiredArgsConstructor
public enum SendRtEnum {

    SEND_RT_0(0, "配置设备ID"),
    SEND_RT_1(1, "心跳数据"),
    SEND_RT_2(2, "上传水卡信息"),
    SEND_RT_3(3, "取水完成上报"),
    SEND_RT_4(4, "下发出水"),
    SEND_RT_5(5, "广告灯控制"),
    SEND_RT_6(6, "温控控制"),
    SEND_RT_7(7, "清除故障码"),
    SEND_RT_8(8, "清洗水罐参数设置"),
    SEND_RT_9(9, "当前时间下发校准"),
    SEND_RT_12(12, "脉冲数调整"),
    SEND_RT_10(10, "单片机复位操作"),
    SEND_RT_11(11, "臭氧状态设置"),
    SEND_RT_44(44, "版本更新下发通知"),
    SEND_RT_45(45, "版本更新下发"),
	SEND_RT_95(95, "通信连接后下发"),
    SEND_RT_97(97, "接收数据后应答"),
    SEND_RT_99(99, "心跳存在");

    private final int rt;
    private final String description;

    /**
     * 根据type获取枚举
     *
     * @param rt
     * @return
     */
    public static SendRtEnum getByRt(int rt){
        for(SendRtEnum sendRtEnum:values()){
            if(sendRtEnum.getRt() == rt){
                return sendRtEnum;
            }
        }
        return null;
    }
}
